--受诬念国
local shouwunianguo = fk.CreateSkill{
    name =  "mcdh_shouwunianguo",
    frequency = Skill.Compulsory,
}

local U = require "packages/utility/utility"
local lib = require "packages/mcdh/lib"

shouwunianguo:addEffect(fk.Damage,{
    can_trigger = function(self, event, target, player, data)
        return player:hasSkill(self) and target == player and data.from and player:usedSkillTimes(self.name,Player.HistoryTurn) == 0
    end,
    on_use = function(self, event, target, player, data)
        local room =player.room
        player:setSkillUseHistory("mcdh_bowencaizhi", 0, Player.HistoryGame)
        local all_choices = {"#shouwunianguo1:"..player.id,"#shouwunianguo2"}
        local choices = {"#shouwunianguo1:"..player.id,"#shouwunianguo2"}
        if player.dead or not player:isWounded() then
            table.removeOne(choices,"#shouwunianguo1:"..player.id)
        end

        local choice = room:askForChoice(data.from, choices, self.name, "#shouwunianguo:", false, all_choices)

        if choice == "#shouwunianguo1:"..player.id then
            data.from:drawCards(1,self.name)
            room:recover{
                who = player,
                num = 1,
                skillName = self.name,
            }
        else
            data.from:drawCards(2,self.name)
        end
    end
})

Fk:loadTranslationTable {
    ["mcdh_shouwunianguo"] = "受诬念国",
    [":mcdh_shouwunianguo"] = "每回合限一次,当你受到伤害后,你可以令〖博文才智〗视为未发动并令伤害来源选择一项:1.摸一张牌并令你回复1点体力;2.摸两张牌。",
    ["#shouwunianguo"] = "受诬念国:请选择一项",
    ["#shouwunianguo1"] = "1.摸一张牌并令 %src 回复1点体力",
    ["#shouwunianguo2"] ="2.摸两张牌"
}

return shouwunianguo